Integrand size = 31, antiderivative size = 231 \[ \int \cos (c+d x) \sqrt {a+b \cos (c+d x)} (A+B \cos (c+d x)) \, dx=\frac {2 \left (5 a A b-2 a^2 B+9 b^2 B\right ) \sqrt {a+b \cos (c+d x)} E\left (\frac {1}{2} (c+d x)|\frac {2 b}{a+b}\right )}{15 b^2 d \sqrt {\frac {a+b \cos (c+d x)}{a+b}}}-\frac {2 \left (a^2-b^2\right ) (5 A b-2 a B) \sqrt {\frac {a+b \cos (c+d x)}{a+b}} \operatorname {EllipticF}\left (\frac {1}{2} (c+d x),\frac {2 b}{a+b}\right )}{15 b^2 d \sqrt {a+b \cos (c+d x)}}+\frac {2 (5 A b-2 a B) \sqrt {a+b \cos (c+d x)} \sin (c+d x)}{15 b d}+\frac {2 B (a+b \cos (c+d x))^{3/2} \sin (c+d x)}{5 b d} \]
[Out]
Time = 0.47 (sec) , antiderivative size = 231, normalized size of antiderivative = 1.00, number of steps used = 8, number of rules used = 8, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.258, Rules used = {3047, 3102, 2832, 2831, 2742, 2740, 2734, 2732} \[ \int \cos (c+d x) \sqrt {a+b \cos (c+d x)} (A+B \cos (c+d x)) \, dx=-\frac {2 \left (a^2-b^2\right ) (5 A b-2 a B) \sqrt {\frac {a+b \cos (c+d x)}{a+b}} \operatorname {EllipticF}\left (\frac {1}{2} (c+d x),\frac {2 b}{a+b}\right )}{15 b^2 d \sqrt {a+b \cos (c+d x)}}+\frac {2 \left (-2 a^2 B+5 a A b+9 b^2 B\right ) \sqrt {a+b \cos (c+d x)} E\left (\frac {1}{2} (c+d x)|\frac {2 b}{a+b}\right )}{15 b^2 d \sqrt {\frac {a+b \cos (c+d x)}{a+b}}}+\frac {2 (5 A b-2 a B) \sin (c+d x) \sqrt {a+b \cos (c+d x)}}{15 b d}+\frac {2 B \sin (c+d x) (a+b \cos (c+d x))^{3/2}}{5 b d} \]
[In]
[Out]
Rule 2732
Rule 2734
Rule 2740
Rule 2742
Rule 2831
Rule 2832
Rule 3047
Rule 3102
Rubi steps \begin{align*} \text {integral}& = \int \sqrt {a+b \cos (c+d x)} \left (A \cos (c+d x)+B \cos ^2(c+d x)\right ) \, dx \\ & = \frac {2 B (a+b \cos (c+d x))^{3/2} \sin (c+d x)}{5 b d}+\frac {2 \int \sqrt {a+b \cos (c+d x)} \left (\frac {3 b B}{2}+\frac {1}{2} (5 A b-2 a B) \cos (c+d x)\right ) \, dx}{5 b} \\ & = \frac {2 (5 A b-2 a B) \sqrt {a+b \cos (c+d x)} \sin (c+d x)}{15 b d}+\frac {2 B (a+b \cos (c+d x))^{3/2} \sin (c+d x)}{5 b d}+\frac {4 \int \frac {\frac {1}{4} b (5 A b+7 a B)+\frac {1}{4} \left (5 a A b-2 a^2 B+9 b^2 B\right ) \cos (c+d x)}{\sqrt {a+b \cos (c+d x)}} \, dx}{15 b} \\ & = \frac {2 (5 A b-2 a B) \sqrt {a+b \cos (c+d x)} \sin (c+d x)}{15 b d}+\frac {2 B (a+b \cos (c+d x))^{3/2} \sin (c+d x)}{5 b d}-\frac {\left (\left (a^2-b^2\right ) (5 A b-2 a B)\right ) \int \frac {1}{\sqrt {a+b \cos (c+d x)}} \, dx}{15 b^2}+\frac {\left (5 a A b-2 a^2 B+9 b^2 B\right ) \int \sqrt {a+b \cos (c+d x)} \, dx}{15 b^2} \\ & = \frac {2 (5 A b-2 a B) \sqrt {a+b \cos (c+d x)} \sin (c+d x)}{15 b d}+\frac {2 B (a+b \cos (c+d x))^{3/2} \sin (c+d x)}{5 b d}+\frac {\left (\left (5 a A b-2 a^2 B+9 b^2 B\right ) \sqrt {a+b \cos (c+d x)}\right ) \int \sqrt {\frac {a}{a+b}+\frac {b \cos (c+d x)}{a+b}} \, dx}{15 b^2 \sqrt {\frac {a+b \cos (c+d x)}{a+b}}}-\frac {\left (\left (a^2-b^2\right ) (5 A b-2 a B) \sqrt {\frac {a+b \cos (c+d x)}{a+b}}\right ) \int \frac {1}{\sqrt {\frac {a}{a+b}+\frac {b \cos (c+d x)}{a+b}}} \, dx}{15 b^2 \sqrt {a+b \cos (c+d x)}} \\ & = \frac {2 \left (5 a A b-2 a^2 B+9 b^2 B\right ) \sqrt {a+b \cos (c+d x)} E\left (\frac {1}{2} (c+d x)|\frac {2 b}{a+b}\right )}{15 b^2 d \sqrt {\frac {a+b \cos (c+d x)}{a+b}}}-\frac {2 \left (a^2-b^2\right ) (5 A b-2 a B) \sqrt {\frac {a+b \cos (c+d x)}{a+b}} \operatorname {EllipticF}\left (\frac {1}{2} (c+d x),\frac {2 b}{a+b}\right )}{15 b^2 d \sqrt {a+b \cos (c+d x)}}+\frac {2 (5 A b-2 a B) \sqrt {a+b \cos (c+d x)} \sin (c+d x)}{15 b d}+\frac {2 B (a+b \cos (c+d x))^{3/2} \sin (c+d x)}{5 b d} \\ \end{align*}
Time = 2.08 (sec) , antiderivative size = 179, normalized size of antiderivative = 0.77 \[ \int \cos (c+d x) \sqrt {a+b \cos (c+d x)} (A+B \cos (c+d x)) \, dx=\frac {2 \sqrt {\frac {a+b \cos (c+d x)}{a+b}} \left (b^2 (5 A b+7 a B) \operatorname {EllipticF}\left (\frac {1}{2} (c+d x),\frac {2 b}{a+b}\right )+\left (5 a A b-2 a^2 B+9 b^2 B\right ) \left ((a+b) E\left (\frac {1}{2} (c+d x)|\frac {2 b}{a+b}\right )-a \operatorname {EllipticF}\left (\frac {1}{2} (c+d x),\frac {2 b}{a+b}\right )\right )\right )+2 b (a+b \cos (c+d x)) (5 A b+a B+3 b B \cos (c+d x)) \sin (c+d x)}{15 b^2 d \sqrt {a+b \cos (c+d x)}} \]
[In]
[Out]
Leaf count of result is larger than twice the leaf count of optimal. \(992\) vs. \(2(269)=538\).
Time = 13.50 (sec) , antiderivative size = 993, normalized size of antiderivative = 4.30
method | result | size |
default | \(\text {Expression too large to display}\) | \(993\) |
parts | \(\text {Expression too large to display}\) | \(1119\) |
[In]
[Out]
Result contains higher order function than in optimal. Order 9 vs. order 4.
Time = 0.15 (sec) , antiderivative size = 492, normalized size of antiderivative = 2.13 \[ \int \cos (c+d x) \sqrt {a+b \cos (c+d x)} (A+B \cos (c+d x)) \, dx=\frac {\sqrt {2} {\left (-4 i \, B a^{3} + 10 i \, A a^{2} b - 3 i \, B a b^{2} - 15 i \, A b^{3}\right )} \sqrt {b} {\rm weierstrassPInverse}\left (\frac {4 \, {\left (4 \, a^{2} - 3 \, b^{2}\right )}}{3 \, b^{2}}, -\frac {8 \, {\left (8 \, a^{3} - 9 \, a b^{2}\right )}}{27 \, b^{3}}, \frac {3 \, b \cos \left (d x + c\right ) + 3 i \, b \sin \left (d x + c\right ) + 2 \, a}{3 \, b}\right ) + \sqrt {2} {\left (4 i \, B a^{3} - 10 i \, A a^{2} b + 3 i \, B a b^{2} + 15 i \, A b^{3}\right )} \sqrt {b} {\rm weierstrassPInverse}\left (\frac {4 \, {\left (4 \, a^{2} - 3 \, b^{2}\right )}}{3 \, b^{2}}, -\frac {8 \, {\left (8 \, a^{3} - 9 \, a b^{2}\right )}}{27 \, b^{3}}, \frac {3 \, b \cos \left (d x + c\right ) - 3 i \, b \sin \left (d x + c\right ) + 2 \, a}{3 \, b}\right ) - 3 \, \sqrt {2} {\left (2 i \, B a^{2} b - 5 i \, A a b^{2} - 9 i \, B b^{3}\right )} \sqrt {b} {\rm weierstrassZeta}\left (\frac {4 \, {\left (4 \, a^{2} - 3 \, b^{2}\right )}}{3 \, b^{2}}, -\frac {8 \, {\left (8 \, a^{3} - 9 \, a b^{2}\right )}}{27 \, b^{3}}, {\rm weierstrassPInverse}\left (\frac {4 \, {\left (4 \, a^{2} - 3 \, b^{2}\right )}}{3 \, b^{2}}, -\frac {8 \, {\left (8 \, a^{3} - 9 \, a b^{2}\right )}}{27 \, b^{3}}, \frac {3 \, b \cos \left (d x + c\right ) + 3 i \, b \sin \left (d x + c\right ) + 2 \, a}{3 \, b}\right )\right ) - 3 \, \sqrt {2} {\left (-2 i \, B a^{2} b + 5 i \, A a b^{2} + 9 i \, B b^{3}\right )} \sqrt {b} {\rm weierstrassZeta}\left (\frac {4 \, {\left (4 \, a^{2} - 3 \, b^{2}\right )}}{3 \, b^{2}}, -\frac {8 \, {\left (8 \, a^{3} - 9 \, a b^{2}\right )}}{27 \, b^{3}}, {\rm weierstrassPInverse}\left (\frac {4 \, {\left (4 \, a^{2} - 3 \, b^{2}\right )}}{3 \, b^{2}}, -\frac {8 \, {\left (8 \, a^{3} - 9 \, a b^{2}\right )}}{27 \, b^{3}}, \frac {3 \, b \cos \left (d x + c\right ) - 3 i \, b \sin \left (d x + c\right ) + 2 \, a}{3 \, b}\right )\right ) + 6 \, {\left (3 \, B b^{3} \cos \left (d x + c\right ) + B a b^{2} + 5 \, A b^{3}\right )} \sqrt {b \cos \left (d x + c\right ) + a} \sin \left (d x + c\right )}{45 \, b^{3} d} \]
[In]
[Out]
\[ \int \cos (c+d x) \sqrt {a+b \cos (c+d x)} (A+B \cos (c+d x)) \, dx=\int \left (A + B \cos {\left (c + d x \right )}\right ) \sqrt {a + b \cos {\left (c + d x \right )}} \cos {\left (c + d x \right )}\, dx \]
[In]
[Out]
\[ \int \cos (c+d x) \sqrt {a+b \cos (c+d x)} (A+B \cos (c+d x)) \, dx=\int { {\left (B \cos \left (d x + c\right ) + A\right )} \sqrt {b \cos \left (d x + c\right ) + a} \cos \left (d x + c\right ) \,d x } \]
[In]
[Out]
\[ \int \cos (c+d x) \sqrt {a+b \cos (c+d x)} (A+B \cos (c+d x)) \, dx=\int { {\left (B \cos \left (d x + c\right ) + A\right )} \sqrt {b \cos \left (d x + c\right ) + a} \cos \left (d x + c\right ) \,d x } \]
[In]
[Out]
Timed out. \[ \int \cos (c+d x) \sqrt {a+b \cos (c+d x)} (A+B \cos (c+d x)) \, dx=\int \cos \left (c+d\,x\right )\,\left (A+B\,\cos \left (c+d\,x\right )\right )\,\sqrt {a+b\,\cos \left (c+d\,x\right )} \,d x \]
[In]
[Out]